<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('suppliers', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->index()->default(0);
            $table->string('remarks')->nullable()->comment('备注');
            $table->string('name', 255)->default('/')->comment('乙方名称');
            $table->string('tax_id', 50)->nullable()->default('/')->comment('乙方税号');
            $table->string('address', 255)->nullable()->default('/')->comment('乙方地址');
            $table->string('mobile', 20)->nullable()->default('/')->comment('乙方联系电话');
            $table->string('bank', 255)->nullable()->default('/')->comment('乙方开户银行');
            $table->string('bank_number', 255)->nullable()->default('/')->comment('乙方开户好');
            $table->string('bank_account', 50)->nullable()->default('/')->comment('乙方银行账号');
            $table->string('email', 255)->nullable()->default('/')->comment('');
            $table->string('postal_code', 50)->nullable()->default('/')->comment('邮编');
            $table->string('authorize_file')->nullable()->default('')->comment('上传委托代理授权书');
            $table->string('business_file')->nullable()->default('')->comment('上传公司营业执照');
            $table->string('idcard_file')->nullable()->default('')->comment('上传法人身份证');
            $table->string('agent_idcard_file')->nullable()->default('')->comment('上传代理人身份证');
            $table->string('legal')->nullable()->default('/')->comment('企业法人');
            $table->string('legal_mobile')->nullable()->default('/')->comment('企业法人联系电话');
            $table->string('agent')->nullable()->default('/')->comment('代理人');
            $table->string('agent_mobile')->nullable()->default('/')->comment('代理人联系电话');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('suppliers');
    }
};
